#ifndef XKIT_COLLECTIONS_STACK_H
#define XKIT_COLLECTIONS_STACK_H

#include "../ref.h"

typedef struct StackHeader {
    Reference *ref;
    size_t length;
    size_t curIndex;
    losu_object_t value;
} StackHeader;

StackHeader *StackInit(losu_vm_t vm, size_t size);
void StackFree(losu_vm_t vm, StackHeader *h);
void StackPush(losu_vm_t vm, StackHeader *h, losu_object_t o);
void StackPop(losu_vm_t vm, StackHeader *h, losu_object_t target);
void StackPeek(losu_vm_t vm, StackHeader *h, losu_object_t target);

#endif